[docs] Obsolete PublishAsConnectionString migration guidance#1237
[docs] Obsolete PublishAsConnectionString migration guidance#1237aspire-repo-bot[bot] wants to merge 1 commit into
Conversation
… use AddConnectionString - Update 'Parameter example' in external-parameters.mdx to use execution-context-based pattern (IsRunMode) instead of the now-obsolete PublishAsConnectionString() API - Update the Japanese localized version of external-parameters.mdx to match - Mark PublishAsConnectionString as obsolete in the azure/overview.mdx API table and add a migration caution callout showing the AddConnectionString pattern with execution context Relates to microsoft/aspire#18044 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
There was a problem hiding this comment.
Pull request overview
Updates Aspire docs to reflect the deprecation of PublishAsConnectionString (Aspire 9.5) and guide users toward an execution-context-based pattern (AddConnectionString + run/publish branching).
Changes:
- Updates external parameters examples to avoid
PublishAsConnectionStringand use execution context branching. - Marks
PublishAsConnectionStringas obsolete in Azure docs and adds a cautionary migration callout. - Updates the Japanese localized fundamentals page to match the new C# guidance.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/frontend/src/content/docs/fundamentals/external-parameters.mdx | Updates C#/TS examples and steps to remove PublishAsConnectionString and use execution-context branching. |
| src/frontend/src/content/docs/integrations/cloud/azure/overview.mdx | Marks API as obsolete and adds a caution callout with a migration example. |
| src/frontend/src/content/docs/ja/fundamentals/external-parameters.mdx | Updates the Japanese C# example and steps to match the new execution-context pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // In run mode, add the actual SQL Server resource. | ||
| // In publish mode, use a connection string representing an external SQL Server instance. | ||
| const db = builder.executionContext.isRunMode | ||
| ? await builder.addSqlServer('sql').then(sql => sql.addDatabase('db')) | ||
| : await builder.addConnectionString('db'); |
| var resource = builder.ExecutionContext.IsPublishMode | ||
| ? builder.AddAzureServiceBus("messaging") | ||
| : builder.AddConnectionString("messaging"); |
| IResourceBuilder<IResourceWithConnectionString> db = builder.ExecutionContext.IsRunMode | ||
| ? builder.AddSqlServer("sql").AddDatabase("db") | ||
| : builder.AddConnectionString("db"); | ||
|
|
||
| var insertionRows = builder.AddParameter("insertionRows"); |
|
We've retriggered CI several times, and the current failures appear to be caused by changes in this PR rather than a transient runner issue. This likely needs updates in the PR content/code to get green checks. |
|
[docs-from-code-ci] CI has been retriggered multiple times and is still failing. This appears to be due to the current PR changes rather than a transient infrastructure issue. |
|
CI has been retriggered multiple times and is still failing for this PR (latest failures: 'CI' (attempt 7)). This likely needs changes in the PR itself rather than another rerun. |
|
CI has already been retriggered many times here, and the current failure still looks content-related rather than transient. Latest failing signal: |
|
This PR has had CI retriggered multiple times and is still failing on PR-specific checks. It likely needs a change in this PR to pass. |
|
[docs-from-code automation] repeated-rerun-note |
|
We've retriggered CI many times on this PR and it's still failing. At this point, the failure likely comes from changes in this PR rather than transient CI flakiness, so this probably needs a content/code fix in the PR itself. |
|
CI has failed repeatedly on this docs-from-code PR after multiple reruns, and the failures appear to be related to the changes in this PR. Please review and adjust the PR content so the checks can pass. |
|
CI has been retriggered multiple times on this PR and is still failing. The failures appear tied to the current PR changes rather than a transient runner issue, so this likely needs an update in the PR content before CI will pass. |
Documents changes from microsoft/aspire#18044 — authored by
@davidfowl.Targeting
release/13.5based on the source PR milestone13.5.Why this PR is needed
PublishAsConnectionString(in bothAspire.HostingandAspire.Hosting.Azure) has been marked[Obsolete]in .NET Aspire 9.5 (microsoft/aspire#18044). The API only changes the manifest representation and does not affect other publishers, which misled callers. Existing users who call it will now receive a CS0618 compiler warning directing them to useAddConnectionStringwith execution context instead.The docs previously contained code examples that called this API and a table entry listing it without any deprecation notice. Without documentation updates, users will see compiler warnings referencing an undocumented migration path.
Why docs are needed
Three signals fired from the source PR:
obsolete_attribute_added:[Obsolete]added toPublishAsConnectionStringinAzureResourceExtensions.csandParameterResourceBuilderExtensions.cspr_body_has_deprecation_marker: PR body explicitly states the extension methods are being made obsoletepr_label_breaking_change: PR carries thebreaking-changelabelChanges made
Updated:
src/frontend/src/content/docs/fundamentals/external-parameters.mdx.PublishAsConnectionString()call in the C# and TypeScript code examples with the preferred execution-context-based pattern usingIsRunMode/executionContext.isRunMode. The run-mode branch adds the actual SQL Server resource; the publish-mode branch usesAddConnectionString.Updated:
src/frontend/src/content/docs/integrations/cloud/azure/overview.mdxPublishAsConnectionStringrow in the API naming-conventions table as (obsolete) and updated its description to point toAddConnectionString.:::cautioncallout block below the table explaining the deprecation and showing the correctExecutionContext.IsPublishModemigration pattern.Updated:
src/frontend/src/content/docs/ja/fundamentals/external-parameters.mdx.PublishAsConnectionString(), used execution-context pattern).Files modified
src/frontend/src/content/docs/fundamentals/external-parameters.mdx(updated)src/frontend/src/content/docs/integrations/cloud/azure/overview.mdx(updated)src/frontend/src/content/docs/ja/fundamentals/external-parameters.mdx(updated)